// range from the point where it left the tray.
const MOUSE_LEFT_ACTOR_THRESHOLD = 20;
+const IDLE_TIME = 1000;
+
const State = {
HIDDEN: 0,
SHOWING: 1,
_showNotification: function(notification) {
this._notification = notification;
- this._userActiveWhileNotificationShown = false;
- this._idleMonitorWatchId = this.idleMonitor.add_watch(1000,
- Lang.bind(this, this._onIdleMonitorWatch));
+ this._userActiveWhileNotificationShown = this.idleMonitor.get_idletime() <= IDLE_TIME;
+ this._idleMonitorWatchId = this.idleMonitor.add_watch(IDLE_TIME,
+ Lang.bind(this, this._onIdleMonitorWatch));
this._notificationClickedId = this._notification.connect('done-displaying',
Lang.bind(this, this._escapeTray));
this._notificationBin.child = this._notification.actor;
g_hash_table_remove (monitor->priv->watches,
GUINT_TO_POINTER (id));
}
+
+gint64
+shell_idle_monitor_get_idletime (ShellIdleMonitor *monitor)
+{
+ XSyncValue value;
+
+ if (!XSyncQueryCounter (monitor->priv->display, monitor->priv->counter, &value))
+ return FALSE;
+
+ return _xsyncvalue_to_int64 (value);
+}
void shell_idle_monitor_remove_watch (ShellIdleMonitor *monitor,
guint id);
+gint64 shell_idle_monitor_get_idletime (ShellIdleMonitor *monitor);
+
G_END_DECLS
#endif /* __SHELL_IDLE_MONITOR_H */